<?php

require_once 'resources/config.php';

$defaultController='country';
$defaultAction='list';

if(! empty($_GET['c']))
   $controller=$_GET['c'];
else
   $controller=$defaultController;

if(! empty($_GET['a']))
   $action=$_GET['a'];
else   
   $action=$defaultAction;

$controller=CONTROLLERS_PATH.'/'.$controller.'.php';
if(is_file($controller))
      require_once $controller;
else
      die('Controller not found - 404 not found');

if(is_callable($action))
      $action();
else
      die('The action does not exist - 404 not found');

?>